<script setup lang="ts">
import { showConfirmDialog } from 'vant';
import { useRouter } from 'vue-router';
const router = useRouter()
const onClick = () => {
    // console.log('退出');
    showConfirmDialog({
        message:
            '确认退出登录？',
    })
    .then(() => {
        localStorage.removeItem('token');
        router.push('/login')
    })
    .catch(() => {
        // on cancel
    });
}
</script>

<template>
    <Headers title="关于"></Headers>
    <van-cell-group>
        <van-cell title="我的资料" is-link to=""/>
        <van-cell title="我的地址" is-link to="" />
        <van-cell title="我的订单" is-link to="/cart" />
        <van-cell title="退出" is-link  @click="onClick"/>
    </van-cell-group>
</template>